With the advent of the computer age, electronic systems have become a staple of modern life, and some may even deem them a necessity. Part and parcel with this spread of technology comes an ever greater drive for more functionality from these electronic systems. To accommodate this desire for increased functionality, these systems may employ high performance processors.
These high performance processors, in turn, are increasingly adding complex features to increase their performance. At the advent of the computer age operating systems were designed to run a single program sequentially. Thus, a single program would execute on a processor, after the conclusion of this program another program could be executed. Uniprogramming of this type eventually became stifling as users desired the ability to perform multiple tasks simultaneously. To circumvent the limitations of uniprogramming, tweaks such as memory-resident programs which could be invoked asynchronously were added to certain operating systems. These tweaks were somewhat problematic, however, as they introduced a wide variety of difficult bugs into the various programs, as most of these uniprogrammed operating systems lacked a significant amount of memory protection.
To alleviate these problems, and allow multiple processes to be active simultaneously, multiprogramming operating systems were designed. These multiprogramming operating systems allow multiple programs to share a single processor. In fact, in most cases this sharing is accomplished so seamlessly that it appears to a user that these multiple programs are executing simultaneously.
These multiprogrammed operating systems are based upon a fundamental concept that a point in the execution of a program is comprised at least partially of a state of a processor. This state, collectively known as the context, may comprise things such as the values of general purpose registers, the stack pointer, the floating point registers, any local store, memory mapped I/O registers, DMA context, etc. Consequently, by saving the state associated with a given instant of a program on a processor, the state can be restored at a later time and the execution of the program resumed. In the interim another program may be executed on the processor.
The ability to implement a multiprogrammed operating system is not without its detriments, however. In order to save the context from, and restore the context to, the processor the context itself must be stored for this intervening time span. In many cases this context is stored to the system stack in system memory, meaning, that every time the context of the processor is placed on the stack from the processor, or retrieved from the stack to be restored to the processor, the system memory must be accessed through the system bus. Accessing and utilizing the system bus to store context entails a large amount of time and overhead relative to the execution of programs on the processor.
Recently a new architecture has been developed for computer processors. Known as a multi-core architecture, this processor architecture is comprised of a core processor element and a number of auxiliary processor elements connected by an inter-chip bus. As may be imagined, in a processor architecture such as this many context switches may occur on a much more frequent basis then in a single processor chip, as context switching may occur with respect to not only the core processor element, but each of the auxiliary processor units as well.
As can be seen then, when accomplishing these context switches in conjunction with multiple auxiliary processor elements, multiple accesses to the system memory and the thus the system bus may be entailed. These repeated access to system memory through the system bus have a soporific effect on the system as a whole, as the time required to achieve these context switches is Brobdingnagian relative to the execution speed of the processor.
Thus, a need exists for efficient methods of context switching which substantially reduce the overhead of saving the context from, and restoring a context to, a processing element.